// Bevel.cs
// chrisb 21/02/2005
// $Header: /Data Analysis/APTPro/APT.Common/Controls/Bevel.cs 3     21/02/05 13:49 Chrisb $
// Copyright APT Inc. 2005

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Diagnostics;

using FreeFlow.Client;

namespace FreeFlow.WinFormsControls
{	
	/// <summary>
	/// Rule control.
	/// </summary>
	public class RuleControl : Bevel, IFillable
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
    
    /// <summary>
    /// Creates a new <see cref="RuleControl"/> instance.
    /// </summary>
		public RuleControl()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if( components != null )
					components.Dispose();
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
		}
		#endregion
		
    #region IFillable Members

    /// <summary>
    /// Renders the label with static layout information using the specified field.
    /// </summary>
    /// <param name="field">Field.</param>
    public void Render(FreeFlow.Client.Field field)
    {
      RuleField ruleField = (RuleField)field;
      BackColor = ruleField.Color;
      Shape = Border3DSide.All;
      Style = (BevelStyle)ruleField.Style;
    }

    /// <summary>
    /// Fills the label with values from the specified field.
    /// </summary>
    /// <param name="field">Field.</param>
    public void Fill(FreeFlow.Client.Field field)
    {
      // does nothing
    }

    /// <summary>
    /// Fills the field from the control.
    /// </summary>
    /// <param name="field">Field.</param>
    public void FillField(Field field)
    {
    }

    #endregion
	}
}
